Skip to content

prm: stop attempting remote branch deletion where the proxy blocks it - #277

Merged
Jammy2211 merged 2 commits into
mainfrom
claude/branch-deletion-permissions-zcwkdc
Aug 25, 2026
Merged

prm: stop attempting remote branch deletion where the proxy blocks it#277
Jammy2211 merged 2 commits into
mainfrom
claude/branch-deletion-permissions-zcwkdc

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Problem

/prm's close-out step 5 assumed every environment could delete a remote ref. In
a proxied web session (Claude Code on the web) it cannot: the egress proxy returns
HTTP 403 on the git-receive-pack POST that carries a ref deletion, and the
GitHub MCP surface exposes no delete verb at all (create_branch exists; nothing
deletes a ref).

The result was every web close-out burning turns on pushes that can never land,
then reporting the failure as if it were a finding.

Confirmed in-session: an ordinary push (branch create) through the same proxy
succeeds, so it is ref deletions specifically that are refused — not git writes
in general. The 403 carries no X-Github-Request-Id while the ref advertisement
to the same host seconds earlier returns 200 with one, so it is generated in
front of GitHub — credentials, gh scopes and branch protection are not the
cause.

Changes

skills/prm/prm.md

  • New environment bullet for a proxied web session, alongside Local and Remote
    (mobile/codex), with a one-shot probe (curl -sf "$HTTPS_PROXY/__agentproxy/status")
    run once before the close-out and remembered for the whole run.
  • Step 5 is treated as out of scope in that environment: nothing attempted,
    nothing reported, branches absent from the ledger.
  • Corrected the remote-environment note, which claimed sub-step 5 ran "as usual"
    over gh — the line that licensed the wasted attempts.

skills/prm/reference.md

  • Step 5 leads with the probe, records the exact 403 signature so a future run
    recognises it immediately, and states why it is not credentials/scopes/branch
    protection — heading off the "try a different token" reflex.
  • Explicit instruction to write no ledger line about branches there: not
    "deferred", not "blocked", not "see /repo_cleanup". The step would say the same
    thing on every close-out, so it is noise rather than a finding.
  • Fallback for any environment that surprises us: stop after the first refusal,
    do not repeat the push per repo, do not narrate the failure.

Why silence loses nothing

/repo_cleanup Bucket B enumerates origin branches directly
(gh api repos/<owner>/<repo>/branches), so it rediscovers these branches on the
next local sweep without being handed a list. Checked before pointing at it — the
handoff does not depend on prm reporting anything.

The ledger's "a skipped step must read as skipped" rule keeps its force and gains
one stated exception: a sub-step the environment makes impossible is omitted
outright. Skipping something that could have been done still gets a line.

Repo-side, enabling "Automatically delete head branches" (Settings → General →
Pull Requests) removes the need for the sub-step altogether.

Docs-only; no executable code paths touched.


Generated by Claude Code

claude added 2 commits August 25, 2026 13:08
Close-out step 5 assumed every environment could delete a remote ref, so a
proxied web session (Claude Code on the web) burned turns on pushes that can
never land: the egress proxy returns HTTP 403 on the git-receive-pack POST
carrying a ref deletion, and the GitHub MCP surface exposes no delete verb.

Add a one-shot environment probe before the close-out, skip the remote half of
step 5 outright when it answers, and defer those branches to /repo_cleanup
(its Bucket B enumerates origin branches, so a local sweep picks them up).
Also correct the remote-environment note, which claimed step 5 ran "as usual"
over gh, and record deferred branches in the ledger alongside deleted ones.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHmxnBNwDGedeUoRJk9iFz
The previous commit stopped the wasted push attempts but still reported the
branches as deferred to /repo_cleanup. Behind the proxy that line would appear
on every close-out saying the same thing, which is noise rather than a finding.

Treat step 5 as out of scope in that environment: attempt nothing, report
nothing, and omit branches from the ledger entirely. Nothing is lost, because
/repo_cleanup Bucket B enumerates origin branches directly and rediscovers them
on the next local sweep without being told. The ledger's "a skipped step must
read as skipped" rule gains one stated exception for a step the environment
makes impossible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHmxnBNwDGedeUoRJk9iFz
@Jammy2211
Jammy2211 merged commit 5fd1d87 into main Aug 25, 2026
2 checks passed
@github-actions
github-actions Bot deleted the claude/branch-deletion-permissions-zcwkdc branch August 25, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants